#include "gtest/gtest.h"

#include <memory>
#include "MemoryObserver.h"

using namespace streamdb;

TEST(MemoryObservertest, use){
    NetSubject net("subject");
    auto  mso = std::make_shared<MemoryObserver>(); 
    net.attach(mso);


    std::shared_ptr<MemoryObserver::StreamConsumer> user = std::make_shared<UserLogin>();
    mso->attach(user);


    net.notify({1, "100000"});
    net.notify({2, "100000"});

    net.notify(OrderedMessage::Null);


    mso->detach(user);
    net.detach(mso);
}




